// index.js
// 获取应用实例

import { request } from "../../request/index.js"

Page({
    data: {
        swiperList: [],
        catesList:[], 
        floorList:[],

    },
    onLoad(options) {
        // 获取轮播图数据
        this.getSwiperList()
        //获取导航栏数据
        this.getCateList()
        this.getFloorList()
    },
    async getSwiperList() {
        const res = (await request({ url: "/home/swiperdata" })).data
        this.setData({
            swiperList: res.message
        })
    },
    async getCateList(){
        const res = (await request({url:"/home/catitems"})).data
        this.setData({
            catesList:res.message
        })
    },
    async getFloorList(){
        const res = (await request({url:"/home/floordata"})).data
        this.setData({
            floorList:res.message
        })
    }
})
